package com.example.check_oa.dubbo;

import com.example.check_oa.model.mapper.BusinessTripApMapper;
import com.example.check_oa.model.service.BusinessTripApService;
import com.example.comment_oa.dubbo.BusiDubbo;
import com.example.comment_oa.pojos.attendance.BusinessTripAp;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

@DubboService(version = "1.0.0",protocol = "${dubbo.protocol.id}",
        application = "${dubbo.application.id}",registry = "${dubbo.registry.id}",
        timeout = 3000)
public class BusiDubboImpl implements BusiDubbo {
    @Resource
    BusinessTripApMapper businessTripApMapper;
    @Resource
    BusinessTripApService businessTripApService;

    @Override
    public List<BusinessTripAp> busiByIdEnd(int id, String endTime) {
        return businessTripApMapper.byIdEnd(id,endTime);
    }

    @Override
    public int apBusi(BusinessTripAp businessTripAp, MultipartFile file) {
        businessTripApService.add(businessTripAp,file);
        return 0;
    }

    @Override
    public int yesBusi(String buId, String yesUser) {
        return businessTripApService.yesBusi(buId,yesUser);
    }

    @Override
    public int noBusi(String buId, String yesUser) {
        return businessTripApService.noBusi(buId,yesUser);
    }
}
